home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / compiler / Prim.sml < prev    next >
Encoding:
Text File  |  1997-08-18  |  1.3 KB  |  61 lines  |  [TEXT/R*ch]

  1. (* The type of primitives *)
  2.  
  3. local
  4.   open Const;
  5. in
  6.  
  7. datatype primitive =
  8.     Pidentity
  9.   | Pget_global of QualifiedIdent * int
  10.   | Pset_global of QualifiedIdent * int
  11.   | Pdummy of int
  12.   | Pupdate
  13.   | Ptest of bool_test
  14.   | Pmakeblock of BlockTag
  15.   | Ptag_of
  16.   | Pfield of int
  17.   | Psetfield of int
  18.   | Pccall of string * int
  19.   | Praise
  20.   | Pnot
  21.   (* The next five are unsigned operations: *)
  22.   | Paddint | Psubint | Pmulint | Pdivint | Pmodint
  23.   | Pandint | Porint | Pxorint
  24.   | Pshiftleftint | Pshiftrightintsigned | Pshiftrightintunsigned
  25.   | Pintoffloat
  26.   | Pfloatprim of float_primitive
  27.   | Pstringlength | Pgetstringchar | Psetstringchar
  28.   | Pmakevector | Pvectlength | Pgetvectitem | Psetvectitem
  29.   | Psmlnegint | Psmlsuccint | Psmlpredint
  30.   | Psmladdint | Psmlsubint | Psmlmulint | Psmldivint | Psmlmodint
  31.   | Pmakerefvector
  32.   | Patom of int
  33.   | Psmlquotint | Psmlremint
  34.   | Pclosure of int * int
  35.   | Pswap
  36.  
  37. and float_primitive =
  38.     Pfloatofint
  39.   | Psmlnegfloat | Psmladdfloat | Psmlsubfloat | Psmlmulfloat | Psmldivfloat
  40.  
  41. and bool_test =
  42.     Peq_test
  43.   | Pnoteq_test
  44.   | Pint_test of int prim_test
  45.   | Pfloat_test of real prim_test
  46.   | Pstring_test of string prim_test
  47.   | Pword_test of word prim_test
  48.   | Pnoteqtag_test of BlockTag
  49.  
  50. and 'a prim_test =
  51.     PTeq
  52.   | PTnoteq
  53.   | PTnoteqimm of 'a
  54.   | PTlt
  55.   | PTle
  56.   | PTgt
  57.   | PTge
  58. ;
  59.  
  60. end;
  61.